<?php

/*generated file. don't modify*/

class ApiPoolError {

    const OK = 200;
    const ERR_STATUS_BAD_REQUEST = 400;
    const ERR_STATUS_UNAUTHORIZED = 401;
    const ERR_STATUS_FORBIDDEN = 403;
    const ERR_STATUS_NOT_FOUND = 404;
    const ERR_STATUS_BAD_PACKET_DATA = 405;
    const ERR_STATUS_BAD_SERVICE_NAME = 406;
    const ERR_REQUEST_TIMEOUT = 407;
    const ERR_STATUS_INTERNAL = 500;
    const ERR_STATUS_NOT_IMPLEMENTED = 501;
    const ERR_STATUS_BAD_GATEWAY = 502;
    const ERR_STATUS_UNAVAILABLE = 503;
    const ERR_INTERNAL_ERROR = 504;
    const ERR_PROTOCOL_ERROR = 505;
    const ERR_CRYPT_UNAUTHORIZED = 506;
    const ERR_UNKNOWN = 600;
    const ERR_REQ = 601;
    const ERR_RPC = 602;
    const ERR_RES = 603;
    const ERR_TIMEOUT = 604;
    const ERR_CONNECT_FAIL = 605;
    const ERR_CONNECTION_ERROR = 606;
    const ERR_SERVER_CLOSE = 607;
    const ERR_CLIENT_CLOSE = 608;
    const ERR_CYPTER_UNKNOWN = 609;
    const ERR_ENCRYPT = 610;
    const ERR_DECRYPT = 611;

    private static $error_map = array(
        self::OK => "Ok",
        self::ERR_STATUS_BAD_REQUEST => "Bad Client Request",
        self::ERR_STATUS_UNAUTHORIZED => "Request Source Authorization Check Failed",
        self::ERR_STATUS_FORBIDDEN => "Request Forbidden",
        self::ERR_STATUS_NOT_FOUND => "Service Not Found",
        self::ERR_STATUS_BAD_PACKET_DATA => "Request Packet Data is not authentic",
        self::ERR_STATUS_BAD_SERVICE_NAME => "Request Service Name is error",
        self::ERR_REQUEST_TIMEOUT => "Request Timeout",
        self::ERR_STATUS_INTERNAL => "Internal Server Error",
        self::ERR_STATUS_NOT_IMPLEMENTED => "Service Not Implemented",
        self::ERR_STATUS_BAD_GATEWAY => "Bad Gateway",
        self::ERR_STATUS_UNAVAILABLE => "Service Unavailable",
        self::ERR_INTERNAL_ERROR => "Internal Error",
        self::ERR_PROTOCOL_ERROR => "Request Invalid Protocol",
        self::ERR_CRYPT_UNAUTHORIZED => "Request Crypt Unauthorized",
        self::ERR_UNKNOWN => "Unknown Error",
        self::ERR_REQ => "Request Format Error",
        self::ERR_RPC => "RPC Error",
        self::ERR_RES => "Response Format Error",
        self::ERR_TIMEOUT => "Client Time Out",
        self::ERR_CONNECT_FAIL => "Cannot Connect Server",
        self::ERR_CONNECTION_ERROR => "Connection Error",
        self::ERR_SERVER_CLOSE => "Server Close The Connect",
        self::ERR_CLIENT_CLOSE => "Client Close",
        self::ERR_CYPTER_UNKNOWN => "Cryter Unknown",
        self::ERR_ENCRYPT => "Encrypt Error",
        self::ERR_DECRYPT => "Decrypt Error",
    );

    public static function translateError($code) {
        $error = self::$error_map[$code];
        if ($error != null)
            return $error;
        return "Unknown";
    }

}

?>
